﻿//See https://aka.ms/new-console-template for more information
using AOP.ConsoleTest;

Console.WriteLine("Hello, World!");
Console.WriteLine("************DecoratorAopTest***********");
new DecoratorAopTest().Handle();

Console.WriteLine("************ProxyAopTest***********");
new ProxyAopTest().Handle();

Console.WriteLine("************DynamicProxyAopTest************");
new DynamicProxyAopTest().Handle();

Console.WriteLine("************CastleProxyAopTest************");
new CastleProxyAopTest().ClassProxy();
new CastleProxyAopTest().InterfaceProxy();

Console.WriteLine("*******************UnityConfigAOP*****************");
new UnityConfigAopTest().Handle();

//测试任务队列执行

var tasks = new List<Task>();
var services = new MessageReceiver();
var beginTime = DateTime.Now;
Console.WriteLine(beginTime);
tasks.Add(services.Task1());
tasks.Add(services.Task2());
tasks.Add(services.Task3());
_ = Task.WhenAll(tasks);

foreach (var task in tasks)
{
    Console.WriteLine(task.Id + "------------" + task.IsCompletedSuccessfully);
}

Console.WriteLine(DateTime.Now);

